<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="长沙市妇幼">
    <link rel="stylesheet" type="text/css" href="./css/wap/public.css" />
    <link rel="stylesheet" type="text/css" href="./css/wap/bangding.css" />
    <script src="./js/jquery.min.js"></script>
    <title>长沙市妇幼</title>

    <!-- Documentation extras -->
    <style>
        body {
            font-family: "Microsoft YaHei UI", "Microsoft YaHei", "ff-tisa-web-pro-1", "ff-tisa-web-pro-2", "Lucida Grande", "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "WenQuanYi Micro Hei", sans-serif;
        }

        h1,
        .h1,
        h2,
        .h2,
        h4,
        .h4,
        h4,
        .h4,
        .lead {
            font-family: "Microsoft YaHei UI", "Microsoft YaHei", "ff-tisa-web-pro-1", "ff-tisa-web-pro-2", "Lucida Grande", "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "WenQuanYi Micro Hei", sans-serif;
        }
    </style>

    <style>
        body {
            padding-top: 0;
            background-color: #f2f2f2;
            height: 100%;
        }
    </style>


    <script type="text/javascript">
        var c = 60;
        var t;
        jQuery.ajaxSetup({ cache: false });

        function findCode() {

            if (!checkMobile("phone")) {
                alert("请填写正确手机号");
                return false;
            }

            var phonevalue = $('#phone').val();
            jQuery.ajax({
                url: "/m/bind_code.do?random=" + Math.random(),//url地址
                data: "phone=" + phonevalue,//要发送的数据   
                type: "get",         //发送的方式
                success: function (result) {
                    //alert(result);
                    if (result == "error") {
                        $("#tipmsg").text("验证码发送失败，请稍后重试。");
                        $("#tip").show();
                        tips();
                    }
                    //处理正确时的信息
                }
            });

            timedMsg();
        }

        function timedMsg() {
            $("#codebtn").attr("disabled", "true");
            $("#codebtn").text("(" + c + ")获取验证码");
            $("#codebtn").attr("class", "btn-unsend");

            if (c == 0) {
                $("#codebtn").text("获取验证码");
                $("#codebtn").removeAttr("disabled");
                $("#codebtn").attr("class", "btn-send");
                clearTimeout(t);
                c = 60;
            } else {
                t = setTimeout('timedMsg()', 1000);
            }
            c--;
        }

        function OnPropChanged(event) {
            timedMsg();
        }

        function checkMobile(mobile) {
            var m = $.trim($("#" + mobile).val());
            if ((/^13\d{9}$/.test(m)) | (/^15\d{9}$/.test(m)) | (/^18\d{9}$/.test(m)) | (/^17\d{9}$/.test(m)) | (/^14\d{9}$/.test(m))) {
                return true;
            }
            return false;
        }

        function codetext() {
            if ($('#code').val().length == 4) {
                if ($("#bindbtn").attr("disabled")) {

                    $("#ban_bt").attr("class", "tian");
                    $("#bindbtn").removeAttr("disabled");
                }
            } else {

                $("#ban_bt").removeAttr("class");
                $('#bindbtn').attr("disabled", true);
            }
        }

        function codeMobile() {

            if (!checkMobile("phone")) {
                if ($("#codebtn").attr("disabled")) {
                } else {
                    $('#codebtn').attr("disabled", true);
                    $("#codebtn").attr("class", "btn-unsend");
                }
            } else {
                $("#codebtn").removeAttr("disabled");
                $("#codebtn").attr("class", "btn-send");

            }
        }

        function bindAct() {
            $("#actform").submit();
        }

        var m = 3;
        var n;
        function loadTip() {
            $("#tip").hide();
            var errormsg = $("#tipmsg").text();
            if (errormsg.length > 0) {
                m = 3;
                $("#tip").show();
                tips();
            }
        }

        function tips() {
            if (m == 0) {
                $("#tip").hide();
                clearTimeout(n);
                m = 3;
            } else {
                n = setTimeout('tips()', 1000);
            }
            m--;
        }

    </script>

</head>

<body onload="loadTip();">

    <div id="mycontent" class="box">

        <form id="actform" action="/m/wx_bind_phone.do" method="post">
            <input id="openid" name="openid" type="hidden" value="wxopenid-001" />
            <input id="act" name="act" type="hidden" value="wx_bind_phone" />

            <div class="inpuBox">
                <div class="row">
                    <input id="phone" name="phone" type="tel" value="" onchange="codeMobile();" oninput="codeMobile();" placeholder="请输入在医院填写的手机号码"
                    />
                    <button id="codebtn" onclick="return findCode();" disabled>获取验证码</button>
                </div>
                <div class="row line"></div>
                <div class="row">
                    <input id="code" name="code" onchange="codetext();" oninput="codetext();" type="tel" placeholder="请输入验证码" />
                </div>
            </div>
            <div id="ban_bt">
                <button id="bindbtn" onclick="bindAct();" disabled>绑&nbsp;&nbsp;&nbsp;&nbsp;定</button>
            </div>

        </form>

        <div class="ntt">
            <h3>注意事项：</h3>
            <ol style="padding-left:20px">
                <li>
                    <p>事关个人隐私，请勿将验证码告诉他人。</p>
                </li>
                <li>
                    <p>该绑定只有在送检单上填写的手机号码才能正确查询结果。</p>
                </li>
                <li>
                    <p>样本数据约在抽血后1-2个工作日录入到系统，在此之前系统不能查找到您的数据。</p>
                </li>
            </ol>
        </div>

    </div>

    <div class="nifty">
        <img src="/images/wap/yixue-logo-line.png" />
    </div>

    <div id="tip" style="display: none;">
        <p id="tipmsg"></p>
    </div>
    <!--================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
</body>

<script>
    //footer吸底效果
    var _ch = $("#mycontent").height();//这个就是中间内容div的高度
    var _wh = $(window).height();//整个窗口的高度
    //console.log("window's height",_wh,"mycontent's height",_ch,"_wh - _ch:",_wh - _ch);
    if (_wh - _ch > 30) {
        $("#mycontent").css("min-height", (_wh - 30) + "px");
    }
</script>

</html>